from typing import List


class Solution:
    def numberOfLines(self, widths: List[int], s: str) -> List[int]:
        lines,chars = 1,0
        for c in s:
            if chars + widths[ord(c)-ord('a')] > 100:
                lines+=1
                chars = widths[ord(c)-ord('a')]
            else:
                chars += widths[ord(c)-ord('a')]
        return [lines,chars]